<%-- 
    Document   : exam-of-class-action
    Created on : Feb 23, 2012, 7:01:14 PM
    Author     : lab
--%>
<%@page import="util.SharingUtil"%>
<%@page import="util.PagingUtil"%>
<%@page import="dto.Exam"%>
<%@page import="java.util.ArrayList"%>
<%@page import="dao.ExamDAO"%>
<%
    ExamDAO daoExam = new ExamDAO();
    int classId = SharingUtil.getCurrentClass(session).getId();
    int totalRecords = 0;
    int currentPage = PagingUtil.getPageNumber(request.getParameter("page"));
    int pageSize = 20;
    ArrayList<Exam> list = daoExam.getExams(currentPage, pageSize, classId);
    totalRecords = daoExam.getTotalRecords();
    String pagingNav = PagingUtil.getPageNavigator(totalRecords, pageSize, currentPage, "?pcontent=exam-of-class&page=");
    request.setAttribute("list", list);
    request.setAttribute("pagingNav", pagingNav);
%>